//
//  BDComplaintsTableViewCell.m
//  BadBoy
//
//  Created by wen on 2017/6/13.
//  Copyright © 2017年 com.8xiong. All rights reserved.
//

#import "BDComplaintsTableViewCell.h"

@interface BDComplaintsTableViewCell ()

@property (nonatomic, strong) UIButton *selectedButton;

@end

@implementation BDComplaintsTableViewCell

- (void)setIs_Selected:(BOOL)is_Selected{
    _is_Selected = is_Selected;
    self.selectedButton.selected = is_Selected;
}

- (UIButton *)selectedButton{
    if (!_selectedButton) {
        self.selectedButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _selectedButton.size = CGSizeMake(25, 25);
        [_selectedButton setBackgroundImage:[UIImage imageNamed:@"tousu_weixuanzhong"] forState:UIControlStateNormal];
        [_selectedButton setBackgroundImage:[UIImage imageNamed:@"tousu_xuanzhong"] forState:UIControlStateSelected];
        _selectedButton.userInteractionEnabled = NO;
    }
    return _selectedButton;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.accessoryView = self.selectedButton;
    
    self.textLabel.font = [UIFont systemFontOfSize:15];
    self.textLabel.textColor = [UIColor colorWithHexString:@"#1c1c1c"];
    
    [self.textLabel sizeToFit];
    self.textLabel.left = 15;
    self.textLabel.centerY = self.height / 2.0;
}

@end
